import request from '../../utils/request';

// 服务分类管理相关 API

// 创建服务分类
export const createServiceCategory = (data: any) => {
    return request({
        url: '/system/api/service-category',
        method: 'post',
        data
    });
};

// 根据ID获取服务分类
export const getServiceCategoryById = (id: string) => {
    return request({
        url: `/system/api/service-category/${id}`,
        method: 'get'
    });
};

// 获取服务分类树
export const getServiceCategoryTree = () => {
    return request({
        url: '/system/api/service-category/tree',
        method: 'get'
    });
};

// 获取启用的服务分类
export const getEnabledServiceCategories = () => {
    return request({
        url: '/system/api/service-category/enabled',
        method: 'get'
    });
};

// 根据父分类ID获取子分类
export const getServiceCategoryChildren = (parentId: string) => {
    return request({
        url: `/system/api/service-category/children/${parentId}`,
        method: 'get'
    });
};

// 更新服务分类
export const updateServiceCategory = (id: string, data: any) => {
    return request({
        url: `/system/api/service-category/${id}`,
        method: 'put',
        data
    });
};

// 删除服务分类
export const deleteServiceCategory = (id: string) => {
    return request({
        url: `/system/api/service-category/${id}`,
        method: 'delete'
    });
};
